package com.h2210c.user.controller;

import com.h2210c.user.fenig.ListCompetitionMemberService;
import com.h2210c.user.fenig.ListCourseService;
import com.h2210c.user.fenig.ListTrainingService;

import com.jiyun.model.Competition;
import com.jiyun.model.Dianzhantype;
import com.jiyun.model.Training;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("peixun")
public class PeixunController {
    @Autowired
    ListCourseService listCourseService;
    @RequestMapping("dianzhanla")
    public void dianzhan(@RequestBody Dianzhantype dianzhantype){
        listCourseService.dianzhan(dianzhantype);
    }
@Autowired
    ListTrainingService listTrainingService;
    @RequestMapping("list")
    public List<Training> list(){
     return  listTrainingService.list();
    }
    @RequestMapping("zuixinpeixun")
    public void zuixinpeixun(){
     listTrainingService.zuixinpeixun();

    }
    @Autowired
    ListCompetitionMemberService listCompetitionMemberService;
    @RequestMapping("jingsaiupdate")
    public void jingsaiupdate(){
        listCompetitionMemberService.jingsaiupdate();
    }
    @RequestMapping("/jingsailist")
    public List<Competition>jingsailist(){
        return listCompetitionMemberService.list();
    }




}
